module MigrationHelpers
  def foreign_key(from_table, from_column, to_table)
    contraint_name = "fk_#{from_table}_#{from_column}"

    execute %{alter table #{from_table}
              add constraint #{contraint_name}
              foreign key (#{from_column})
              references #{to_table}(id)}
  end
end
